{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "import scipy.stats as stats\n",
    "import glob as glob\n",
    "import os"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Compute BONOBO networks\n",
    "\n",
    "To compute BONOBO networks we need a tab separated expression file, with samples on the columns and genes on the rows.\n",
    "\n",
    "In this case we have generated the file from the [Gene regulatory network reconstruction using single-cell RNA sequencing of barcoded genotypes in diverse environments](https://elifesciences.org/articles/51254) \n",
    "raw data ([GEO:SE125162](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE125162))  following these steps:\n",
    "\n",
    "Creating pseudobulk from raw counts: \n",
    "- group by Genotype and condition and averaging counts by gene. (132 genotype x condition, 6529 non-zero genes)\n",
    "- Remove genes there are always zero (GSE125162_all_pseudobulk_counts.txt)\n",
    "- df_nonzero_log = np.log(1+df_nonzero) (GSE125162_all_pseudobulk_logcounts.txt)\n",
    "\n",
    "The data is composed of 132 samples and 6520 genes."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Cleaned and pseudobulked data\n",
    "yeast_expression = '../data/processed_data/GSE125162_all_pseudobulk_logcounts.txt'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Compute the networks\n",
    "\n",
    "BONOBO can be simply computed by first instantiating the Bonobo class, and then calling the run_bonobo method.\n",
    "\n",
    "Below is the example on how these networks have been generated"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "BONOBO: preparing expression\n",
      "Reading expression data...\n",
      "None\n",
      "  Elapsed time: 0.11 sec.\n",
      "BONOBO: We are starting to compute the bonobos...\n",
      "BONOBO: bonobo for sample WT(ho)_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample WT(ho)_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample WT(ho)_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample WT(ho)_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample WT(ho)_CStarve\n",
      "BONOBO: computing bonobo for sample WT(ho)_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample WT(ho)_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample WT(ho)_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample WT(ho)_Glutamine\n",
      "BONOBO: computing bonobo for sample WT(ho)_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample WT(ho)_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample WT(ho)_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample WT(ho)_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample WT(ho)_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample WT(ho)_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample WT(ho)_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample WT(ho)_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample WT(ho)_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample WT(ho)_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample WT(ho)_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample WT(ho)_Proline\n",
      "BONOBO: computing bonobo for sample WT(ho)_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample WT(ho)_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample WT(ho)_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample WT(ho)_Urea\n",
      "BONOBO: computing bonobo for sample WT(ho)_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample WT(ho)_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample WT(ho)_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample WT(ho)_YPD\n",
      "BONOBO: computing bonobo for sample WT(ho)_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample WT(ho)_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample WT(ho)_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample WT(ho)_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample WT(ho)_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample WT(ho)_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample WT(ho)_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample WT(ho)_YPDRapa\n",
      "BONOBO: computing bonobo for sample WT(ho)_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample WT(ho)_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample WT(ho)_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample WT(ho)_YPEtOH\n",
      "BONOBO: computing bonobo for sample WT(ho)_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample WT(ho)_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample WT(ho)_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal80_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample dal80_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal80_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal80_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal80_CStarve\n",
      "BONOBO: computing bonobo for sample dal80_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal80_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal80_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal80_Glutamine\n",
      "BONOBO: computing bonobo for sample dal80_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal80_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal80_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal80_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample dal80_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal80_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal80_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal80_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample dal80_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal80_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal80_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal80_Proline\n",
      "BONOBO: computing bonobo for sample dal80_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal80_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal80_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal80_Urea\n",
      "BONOBO: computing bonobo for sample dal80_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal80_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal80_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal80_YPD\n",
      "BONOBO: computing bonobo for sample dal80_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal80_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal80_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal80_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample dal80_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal80_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal80_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal80_YPDRapa\n",
      "BONOBO: computing bonobo for sample dal80_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal80_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal80_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal80_YPEtOH\n",
      "BONOBO: computing bonobo for sample dal80_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal80_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal80_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal81_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample dal81_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal81_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal81_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal81_CStarve\n",
      "BONOBO: computing bonobo for sample dal81_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal81_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal81_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal81_Glutamine\n",
      "BONOBO: computing bonobo for sample dal81_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal81_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal81_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal81_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample dal81_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal81_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal81_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal81_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample dal81_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal81_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal81_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal81_Proline\n",
      "BONOBO: computing bonobo for sample dal81_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal81_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal81_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal81_Urea\n",
      "BONOBO: computing bonobo for sample dal81_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal81_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal81_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal81_YPD\n",
      "BONOBO: computing bonobo for sample dal81_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal81_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal81_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal81_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample dal81_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal81_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal81_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal81_YPDRapa\n",
      "BONOBO: computing bonobo for sample dal81_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal81_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal81_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal81_YPEtOH\n",
      "BONOBO: computing bonobo for sample dal81_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal81_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal81_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal82_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample dal82_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal82_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal82_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal82_CStarve\n",
      "BONOBO: computing bonobo for sample dal82_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal82_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal82_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal82_Glutamine\n",
      "BONOBO: computing bonobo for sample dal82_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal82_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal82_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal82_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample dal82_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal82_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal82_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal82_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample dal82_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal82_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal82_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal82_Proline\n",
      "BONOBO: computing bonobo for sample dal82_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal82_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal82_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal82_Urea\n",
      "BONOBO: computing bonobo for sample dal82_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal82_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal82_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal82_YPD\n",
      "BONOBO: computing bonobo for sample dal82_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal82_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal82_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal82_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample dal82_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal82_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal82_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal82_YPDRapa\n",
      "BONOBO: computing bonobo for sample dal82_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal82_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal82_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample dal82_YPEtOH\n",
      "BONOBO: computing bonobo for sample dal82_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample dal82_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample dal82_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gat1_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample gat1_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gat1_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gat1_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gat1_CStarve\n",
      "BONOBO: computing bonobo for sample gat1_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gat1_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gat1_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gat1_Glutamine\n",
      "BONOBO: computing bonobo for sample gat1_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gat1_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gat1_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gat1_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample gat1_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gat1_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gat1_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gat1_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample gat1_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gat1_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gat1_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gat1_Proline\n",
      "BONOBO: computing bonobo for sample gat1_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gat1_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gat1_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gat1_Urea\n",
      "BONOBO: computing bonobo for sample gat1_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gat1_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gat1_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gat1_YPD\n",
      "BONOBO: computing bonobo for sample gat1_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gat1_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gat1_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gat1_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample gat1_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gat1_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gat1_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gat1_YPDRapa\n",
      "BONOBO: computing bonobo for sample gat1_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gat1_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gat1_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gat1_YPEtOH\n",
      "BONOBO: computing bonobo for sample gat1_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gat1_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gat1_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gcn4_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample gcn4_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gcn4_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gcn4_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gcn4_CStarve\n",
      "BONOBO: computing bonobo for sample gcn4_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gcn4_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gcn4_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gcn4_Glutamine\n",
      "BONOBO: computing bonobo for sample gcn4_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gcn4_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gcn4_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gcn4_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample gcn4_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gcn4_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gcn4_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gcn4_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample gcn4_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gcn4_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gcn4_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gcn4_Proline\n",
      "BONOBO: computing bonobo for sample gcn4_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gcn4_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gcn4_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gcn4_Urea\n",
      "BONOBO: computing bonobo for sample gcn4_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gcn4_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gcn4_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gcn4_YPD\n",
      "BONOBO: computing bonobo for sample gcn4_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gcn4_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gcn4_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gcn4_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample gcn4_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gcn4_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gcn4_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gcn4_YPDRapa\n",
      "BONOBO: computing bonobo for sample gcn4_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gcn4_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gcn4_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gcn4_YPEtOH\n",
      "BONOBO: computing bonobo for sample gcn4_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gcn4_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gcn4_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gln3_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample gln3_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gln3_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gln3_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gln3_CStarve\n",
      "BONOBO: computing bonobo for sample gln3_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gln3_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gln3_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gln3_Glutamine\n",
      "BONOBO: computing bonobo for sample gln3_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gln3_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gln3_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gln3_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample gln3_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gln3_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gln3_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gln3_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample gln3_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gln3_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gln3_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gln3_Proline\n",
      "BONOBO: computing bonobo for sample gln3_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gln3_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gln3_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gln3_Urea\n",
      "BONOBO: computing bonobo for sample gln3_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gln3_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gln3_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gln3_YPD\n",
      "BONOBO: computing bonobo for sample gln3_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gln3_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gln3_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gln3_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample gln3_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gln3_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gln3_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gln3_YPDRapa\n",
      "BONOBO: computing bonobo for sample gln3_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gln3_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gln3_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gln3_YPEtOH\n",
      "BONOBO: computing bonobo for sample gln3_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gln3_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gln3_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gzf3_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample gzf3_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gzf3_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gzf3_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gzf3_CStarve\n",
      "BONOBO: computing bonobo for sample gzf3_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gzf3_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gzf3_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gzf3_Glutamine\n",
      "BONOBO: computing bonobo for sample gzf3_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gzf3_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gzf3_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gzf3_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample gzf3_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gzf3_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gzf3_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gzf3_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample gzf3_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gzf3_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gzf3_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gzf3_Proline\n",
      "BONOBO: computing bonobo for sample gzf3_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gzf3_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gzf3_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gzf3_Urea\n",
      "BONOBO: computing bonobo for sample gzf3_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gzf3_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gzf3_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gzf3_YPD\n",
      "BONOBO: computing bonobo for sample gzf3_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gzf3_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gzf3_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gzf3_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample gzf3_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gzf3_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gzf3_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gzf3_YPDRapa\n",
      "BONOBO: computing bonobo for sample gzf3_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gzf3_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gzf3_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample gzf3_YPEtOH\n",
      "BONOBO: computing bonobo for sample gzf3_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample gzf3_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample gzf3_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg1_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample rtg1_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg1_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg1_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg1_CStarve\n",
      "BONOBO: computing bonobo for sample rtg1_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg1_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg1_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg1_Glutamine\n",
      "BONOBO: computing bonobo for sample rtg1_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg1_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg1_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg1_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample rtg1_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg1_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg1_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg1_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample rtg1_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg1_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg1_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg1_Proline\n",
      "BONOBO: computing bonobo for sample rtg1_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg1_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg1_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg1_Urea\n",
      "BONOBO: computing bonobo for sample rtg1_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg1_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg1_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg1_YPD\n",
      "BONOBO: computing bonobo for sample rtg1_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg1_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg1_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg1_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample rtg1_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg1_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg1_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg1_YPDRapa\n",
      "BONOBO: computing bonobo for sample rtg1_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg1_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg1_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg1_YPEtOH\n",
      "BONOBO: computing bonobo for sample rtg1_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg1_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg1_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg3_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample rtg3_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg3_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg3_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg3_CStarve\n",
      "BONOBO: computing bonobo for sample rtg3_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg3_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg3_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg3_Glutamine\n",
      "BONOBO: computing bonobo for sample rtg3_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg3_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg3_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg3_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample rtg3_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg3_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg3_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg3_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample rtg3_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg3_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg3_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg3_Proline\n",
      "BONOBO: computing bonobo for sample rtg3_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg3_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg3_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg3_Urea\n",
      "BONOBO: computing bonobo for sample rtg3_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg3_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg3_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg3_YPD\n",
      "BONOBO: computing bonobo for sample rtg3_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg3_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg3_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg3_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample rtg3_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg3_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg3_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg3_YPDRapa\n",
      "BONOBO: computing bonobo for sample rtg3_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg3_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg3_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample rtg3_YPEtOH\n",
      "BONOBO: computing bonobo for sample rtg3_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample rtg3_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample rtg3_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp1_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample stp1_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp1_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp1_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp1_CStarve\n",
      "BONOBO: computing bonobo for sample stp1_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp1_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp1_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp1_Glutamine\n",
      "BONOBO: computing bonobo for sample stp1_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp1_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp1_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp1_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample stp1_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp1_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp1_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp1_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample stp1_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp1_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp1_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp1_Proline\n",
      "BONOBO: computing bonobo for sample stp1_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp1_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp1_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp1_Urea\n",
      "BONOBO: computing bonobo for sample stp1_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp1_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp1_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp1_YPD\n",
      "BONOBO: computing bonobo for sample stp1_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp1_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp1_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp1_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample stp1_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp1_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp1_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp1_YPDRapa\n",
      "BONOBO: computing bonobo for sample stp1_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp1_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp1_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp1_YPEtOH\n",
      "BONOBO: computing bonobo for sample stp1_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp1_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp1_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp2_AmmoniumSulfate\n",
      "BONOBO: computing bonobo for sample stp2_AmmoniumSulfate\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp2_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp2_AmmoniumSulfate\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp2_CStarve\n",
      "BONOBO: computing bonobo for sample stp2_CStarve\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp2_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp2_CStarve\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp2_Glutamine\n",
      "BONOBO: computing bonobo for sample stp2_Glutamine\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp2_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp2_Glutamine\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp2_MinimalEtOH\n",
      "BONOBO: computing bonobo for sample stp2_MinimalEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp2_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp2_MinimalEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp2_MinimalGlucose\n",
      "BONOBO: computing bonobo for sample stp2_MinimalGlucose\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp2_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp2_MinimalGlucose\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp2_Proline\n",
      "BONOBO: computing bonobo for sample stp2_Proline\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp2_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp2_Proline\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp2_Urea\n",
      "BONOBO: computing bonobo for sample stp2_Urea\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp2_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp2_Urea\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp2_YPD\n",
      "BONOBO: computing bonobo for sample stp2_YPD\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp2_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp2_YPD\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp2_YPDDiauxic\n",
      "BONOBO: computing bonobo for sample stp2_YPDDiauxic\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp2_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp2_YPDDiauxic\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp2_YPDRapa\n",
      "BONOBO: computing bonobo for sample stp2_YPDRapa\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp2_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp2_YPDRapa\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "BONOBO: bonobo for sample stp2_YPEtOH\n",
      "BONOBO: computing bonobo for sample stp2_YPEtOH\n",
      "keep Bonobo whole, and use pvals to threshold and sparsify\n",
      "Saving BONOBO for sample stp2_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n",
      "Saving pvalues for sample stp2_YPEtOH\n",
      "WARNING: output format (hd5) not recognised. We are saving in hdf\n"
     ]
    }
   ],
   "source": [
    "from netZooPy.ligress.bonobo import Bonobo\n",
    "# Initialize bonobo object\n",
    "bonobo_obj_sparse = Bonobo(yeast_expression)\n",
    "# If you want to run bonobo with a subset of the data, you can specify the sample names and pass them to the run_bonobo\n",
    "# method. In this case we are using all samples\n",
    "sample_names=['WT(ho)_AmmoniumSulfate','WT(ho)_CStarve','WT(ho)_Glutamine']\n",
    "\n",
    "# Run the actual bonobo computation. \n",
    "\n",
    "# The output will be saved in the specified output_folder\n",
    "output_folder = 'data/networks/bonobo_inferelator_sparse_20230908/'\n",
    "# We cannot keep all the data in memory in this case, these networks are too large: keep_in_memory=False\n",
    "# We will save the p-values for the edges in the output_folder: sparsify=True, save_pvals=True\n",
    "# The output format is hd5, which is the most efficient way to store the data on disk, output_fmt='hd5'\n",
    "bonobo_obj_sparse.run_bonobo( keep_in_memory=False, output_fmt='hd5', sparsify=True, output_folder=output_folder, save_pvals=True)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Get the BONOBO networks for the analysis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "def get_bonobo_dataframe(nets_fn, pvals_prefix = None, strategy = 'sparse', pth = 0.1):\n",
    "\n",
    "    df_bonobos = pd.DataFrame()\n",
    "\n",
    "    for iii,bbb in enumerate(nets_fn):\n",
    "        print(bbb)\n",
    "        if iii>-1:\n",
    "            k = bbb.split('/')[-1][:-3][7:]\n",
    "            temp = pd.read_hdf(bbb)\n",
    "                \n",
    "            temp.index = temp.columns\n",
    "            # Upper triangular matrix\n",
    "            temp = temp.where(np.triu(np.ones(temp.shape), k = 1).astype(bool))\n",
    "            # Put in long format\n",
    "            temp = temp.stack().reset_index() \n",
    "            # Rename columns\n",
    "            temp.columns = ['gene1','gene2',k]\n",
    "            \n",
    "            if strategy == 'sparse':\n",
    "                \n",
    "                print(pvals_prefix + k + '.h5')\n",
    "                assert os.path.isfile(pvals_prefix + k + '.h5'), 'pvals file not found'\n",
    "                pvals_fn = pvals_prefix + k + '.h5'\n",
    "                pvals = pd.read_hdf(pvals_fn)\n",
    "                pvals = pvals.where(np.triu(np.ones(pvals.shape), k = 1).astype(bool))\n",
    "                pvals = pvals.stack().reset_index() \n",
    "                \n",
    "                ps = pvals.iloc[:,2].values\n",
    "                \n",
    "                temp = temp[ps<pth]\n",
    "\n",
    "                if iii== 0:\n",
    "                    df_bonobos = temp\n",
    "                else:\n",
    "                    df_bonobos = pd.merge(df_bonobos, temp, how = 'outer', on = ['gene1','gene2'])\n",
    "\n",
    "            else:\n",
    "                if iii == 0:\n",
    "                    df_bonobos = temp\n",
    "                else:\n",
    "                    df_bonobos[k] = temp[k]\n",
    "            \n",
    "\n",
    "    return(df_bonobos)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### BONOBO sparse\n",
    "\n",
    "Here you should change the paths depending on where you want to save the data."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "#nets_fn = glob.glob('bonobo_inferelator_sparse_20230908/bonobo*.h5')\n",
    "#pvals_prefix = ('bonobo_inferelator_sparse_20230908/pvals_')\n",
    "\n",
    "nets_fn = glob.glob('../data/networks/bonobo_20230908/bonobo*.h5')\n",
    "pvals_prefix = ('../data/networks/bonobo_20230908/pvals_')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "../data/networks/bonobo_20230908/bonobo_dal82_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal82_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal81_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal81_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gln3_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_gln3_YPD.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp1_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp1_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal81_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal81_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal82_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal82_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_WT(ho)_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_WT(ho)_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gat1_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_gat1_YPD.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal81_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal81_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp1_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp1_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg1_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg1_YPD.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal80_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal80_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gat1_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_gat1_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp1_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp1_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal80_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal80_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp2_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp2_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg1_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg1_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gcn4_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_gcn4_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg3_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg3_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_WT(ho)_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_WT(ho)_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg1_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg1_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gln3_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_gln3_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal81_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal81_YPD.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal82_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal82_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp2_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp2_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg3_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg3_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp2_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp2_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal82_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal82_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gat1_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_gat1_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gln3_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_gln3_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gln3_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_gln3_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg3_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg3_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal80_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal80_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gzf3_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_gzf3_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp2_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp2_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal80_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal80_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal82_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal82_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp2_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp2_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gcn4_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_gcn4_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gln3_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_gln3_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal82_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal82_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp2_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp2_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp2_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp2_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gat1_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_gat1_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gat1_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_gat1_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg1_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg1_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal81_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal81_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg3_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg3_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gzf3_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_gzf3_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg1_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg1_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg1_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg1_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal82_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal82_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_WT(ho)_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_WT(ho)_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal80_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal80_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_WT(ho)_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_WT(ho)_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gcn4_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_gcn4_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gcn4_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_gcn4_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp2_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp2_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gat1_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_gat1_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal82_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal82_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_WT(ho)_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_WT(ho)_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp1_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp1_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp2_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp2_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_WT(ho)_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_WT(ho)_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal81_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal81_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gzf3_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_gzf3_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gcn4_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_gcn4_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal80_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal80_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_WT(ho)_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_WT(ho)_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_WT(ho)_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_WT(ho)_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gat1_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_gat1_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gln3_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_gln3_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gat1_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_gat1_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal82_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal82_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal80_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal80_YPD.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp1_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp1_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gzf3_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_gzf3_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal80_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal80_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_WT(ho)_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_WT(ho)_YPD.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp1_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp1_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gzf3_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_gzf3_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gzf3_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_gzf3_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gzf3_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_gzf3_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal81_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal81_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp1_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp1_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp1_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp1_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gat1_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_gat1_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp1_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp1_YPD.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gat1_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_gat1_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gcn4_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_gcn4_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal82_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal82_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gzf3_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_gzf3_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gzf3_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_gzf3_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gln3_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_gln3_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal80_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal80_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gcn4_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_gcn4_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp1_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp1_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal80_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal80_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg3_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg3_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp2_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp2_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp2_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp2_YPD.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg1_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg1_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gln3_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_gln3_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gln3_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_gln3_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal81_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal81_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg3_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg3_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gcn4_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_gcn4_YPD.h5\n",
      "../data/networks/bonobo_20230908/bonobo_WT(ho)_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_WT(ho)_MinimalEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gzf3_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_gzf3_YPD.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gcn4_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_gcn4_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gln3_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_gln3_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg3_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg3_AmmoniumSulfate.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg3_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg3_YPD.h5\n",
      "../data/networks/bonobo_20230908/bonobo_stp1_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_stp1_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal81_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal81_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal81_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal81_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg3_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg3_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg1_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg1_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gcn4_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_gcn4_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gat1_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_gat1_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gzf3_Proline.h5\n",
      "../data/networks/bonobo_20230908/pvals_gzf3_Proline.h5\n",
      "../data/networks/bonobo_20230908/bonobo_WT(ho)_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_WT(ho)_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal80_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal80_YPEtOH.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg1_CStarve.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg1_CStarve.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg3_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg3_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gln3_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/pvals_gln3_YPDRapa.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg3_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg3_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_gcn4_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/pvals_gcn4_YPDDiauxic.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal81_Urea.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal81_Urea.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg1_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg1_Glutamine.h5\n",
      "../data/networks/bonobo_20230908/bonobo_rtg1_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/pvals_rtg1_MinimalGlucose.h5\n",
      "../data/networks/bonobo_20230908/bonobo_dal82_YPD.h5\n",
      "../data/networks/bonobo_20230908/pvals_dal82_YPD.h5\n"
     ]
    }
   ],
   "source": [
    "bonobo_sparse = get_bonobo_dataframe(nets_fn, pvals_prefix = pvals_prefix, strategy = 'sparse', pth=0.01)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [],
   "source": [
    "bonobo_sparse.to_hdf('../data/networks/bonobo_sparse_temp_001.h5', key='bonobo_sparse', mode='w')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "if os.path.isdir('data/networks/bonobo/') == False:\n",
    "    os.mkdir('data/networks/bonobo/')\n",
    "bonobo_sparse.to_csv('data/networks/bonobo/bonobo_sparse.csv', index = False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### BONOBO top1k"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'get_bonobo_dataframe' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[9], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m df_all \u001b[38;5;241m=\u001b[39m \u001b[43mget_bonobo_dataframe\u001b[49m(nets_fn, strategy \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mall\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m      2\u001b[0m df_all\u001b[38;5;241m.\u001b[39mcolumns \u001b[38;5;241m=\u001b[39m[i[\u001b[38;5;241m7\u001b[39m:] \u001b[38;5;28;01mif\u001b[39;00m i\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mbonobo\u001b[39m\u001b[38;5;124m'\u001b[39m) \u001b[38;5;28;01melse\u001b[39;00m i \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m df_all\u001b[38;5;241m.\u001b[39mcolumns]\n\u001b[1;32m      3\u001b[0m \u001b[38;5;66;03m# Get top 1k edges\u001b[39;00m\n",
      "\u001b[0;31mNameError\u001b[0m: name 'get_bonobo_dataframe' is not defined"
     ]
    }
   ],
   "source": [
    "df_all = get_bonobo_dataframe(nets_fn, strategy = 'all')\n",
    "df_all.columns =[i[7:] if i.startswith('bonobo') else i for i in df_all.columns]\n",
    "# Get top 1k edges\n",
    "mean = df_all.iloc[:,2:].mean(axis = 1)\n",
    "mean.sort_values(ascending = False, inplace = True)\n",
    "# Get top 1K\n",
    "top_1k = np.r_[mean.index.values[:500], mean.index.values[-500:]]\n",
    "df_top1k = df_all.iloc[top_1k, :]\n",
    "#df_top1k\n",
    "if os.path.isdir('data/networks/bonobo/') == False:\n",
    "    os.mkdir('data/networks/bonobo/')\n",
    "df_top1k.to_csv('data/networks/bonobo/bonobo_top1k.csv', index = False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_hdf('../data/networks/remove/bonobo_dal80_MinimalGlucose.h5')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(5804, 132)"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('../data/networks/remove/gse125162_all_pseudobulk_mean_logcounts.tsv', sep = '\\t', index_col = 0)\n",
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>WT(ho)_AmmoniumSulfate</th>\n",
       "      <th>WT(ho)_CStarve</th>\n",
       "      <th>WT(ho)_Glutamine</th>\n",
       "      <th>WT(ho)_MinimalEtOH</th>\n",
       "      <th>WT(ho)_MinimalGlucose</th>\n",
       "      <th>WT(ho)_Proline</th>\n",
       "      <th>WT(ho)_Urea</th>\n",
       "      <th>WT(ho)_YPD</th>\n",
       "      <th>WT(ho)_YPDDiauxic</th>\n",
       "      <th>WT(ho)_YPDRapa</th>\n",
       "      <th>...</th>\n",
       "      <th>stp2_CStarve</th>\n",
       "      <th>stp2_Glutamine</th>\n",
       "      <th>stp2_MinimalEtOH</th>\n",
       "      <th>stp2_MinimalGlucose</th>\n",
       "      <th>stp2_Proline</th>\n",
       "      <th>stp2_Urea</th>\n",
       "      <th>stp2_YPD</th>\n",
       "      <th>stp2_YPDDiauxic</th>\n",
       "      <th>stp2_YPDRapa</th>\n",
       "      <th>stp2_YPEtOH</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>YDL248W</th>\n",
       "      <td>0.00000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.004890</td>\n",
       "      <td>0.015267</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.003180</td>\n",
       "      <td>0.002144</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.004040</td>\n",
       "      <td>0.009852</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.006494</td>\n",
       "      <td>0.003743</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>YDL244W</th>\n",
       "      <td>0.00000</td>\n",
       "      <td>0.012474</td>\n",
       "      <td>0.006734</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.006780</td>\n",
       "      <td>0.001024</td>\n",
       "      <td>0.028259</td>\n",
       "      <td>0.022282</td>\n",
       "      <td>...</td>\n",
       "      <td>0.017778</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.035091</td>\n",
       "      <td>0.012073</td>\n",
       "      <td>0.009852</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.001278</td>\n",
       "      <td>0.012945</td>\n",
       "      <td>0.024693</td>\n",
       "      <td>0.061875</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>YDL243C</th>\n",
       "      <td>0.00823</td>\n",
       "      <td>0.044997</td>\n",
       "      <td>0.020068</td>\n",
       "      <td>0.074108</td>\n",
       "      <td>0.014599</td>\n",
       "      <td>0.015267</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.030275</td>\n",
       "      <td>0.111393</td>\n",
       "      <td>0.105790</td>\n",
       "      <td>...</td>\n",
       "      <td>0.043867</td>\n",
       "      <td>0.030583</td>\n",
       "      <td>0.194156</td>\n",
       "      <td>0.035789</td>\n",
       "      <td>0.019608</td>\n",
       "      <td>0.017242</td>\n",
       "      <td>0.020254</td>\n",
       "      <td>0.090263</td>\n",
       "      <td>0.113329</td>\n",
       "      <td>0.068520</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>YDL241W</th>\n",
       "      <td>0.00823</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.013232</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.009610</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.006192</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.017242</td>\n",
       "      <td>0.006374</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.004988</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>YDL240W</th>\n",
       "      <td>0.00823</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.013423</td>\n",
       "      <td>0.037740</td>\n",
       "      <td>0.019418</td>\n",
       "      <td>0.015267</td>\n",
       "      <td>0.020203</td>\n",
       "      <td>0.004090</td>\n",
       "      <td>0.003180</td>\n",
       "      <td>0.018076</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.012346</td>\n",
       "      <td>0.052186</td>\n",
       "      <td>0.027946</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.008658</td>\n",
       "      <td>0.005102</td>\n",
       "      <td>0.009725</td>\n",
       "      <td>0.009950</td>\n",
       "      <td>0.027974</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 132 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         WT(ho)_AmmoniumSulfate  WT(ho)_CStarve  WT(ho)_Glutamine  \\\n",
       "YDL248W                 0.00000        0.000000          0.000000   \n",
       "YDL244W                 0.00000        0.012474          0.006734   \n",
       "YDL243C                 0.00823        0.044997          0.020068   \n",
       "YDL241W                 0.00823        0.000000          0.000000   \n",
       "YDL240W                 0.00823        0.000000          0.013423   \n",
       "\n",
       "         WT(ho)_MinimalEtOH  WT(ho)_MinimalGlucose  WT(ho)_Proline  \\\n",
       "YDL248W            0.000000               0.004890        0.015267   \n",
       "YDL244W            0.000000               0.000000        0.000000   \n",
       "YDL243C            0.074108               0.014599        0.015267   \n",
       "YDL241W            0.000000               0.000000        0.000000   \n",
       "YDL240W            0.037740               0.019418        0.015267   \n",
       "\n",
       "         WT(ho)_Urea  WT(ho)_YPD  WT(ho)_YPDDiauxic  WT(ho)_YPDRapa  ...  \\\n",
       "YDL248W     0.000000    0.000000           0.003180        0.002144  ...   \n",
       "YDL244W     0.006780    0.001024           0.028259        0.022282  ...   \n",
       "YDL243C     0.000000    0.030275           0.111393        0.105790  ...   \n",
       "YDL241W     0.000000    0.013232           0.000000        0.009610  ...   \n",
       "YDL240W     0.020203    0.004090           0.003180        0.018076  ...   \n",
       "\n",
       "         stp2_CStarve  stp2_Glutamine  stp2_MinimalEtOH  stp2_MinimalGlucose  \\\n",
       "YDL248W      0.000000        0.000000          0.000000             0.004040   \n",
       "YDL244W      0.017778        0.000000          0.035091             0.012073   \n",
       "YDL243C      0.043867        0.030583          0.194156             0.035789   \n",
       "YDL241W      0.000000        0.006192          0.000000             0.000000   \n",
       "YDL240W      0.000000        0.012346          0.052186             0.027946   \n",
       "\n",
       "         stp2_Proline  stp2_Urea  stp2_YPD  stp2_YPDDiauxic  stp2_YPDRapa  \\\n",
       "YDL248W      0.009852   0.000000  0.000000         0.006494      0.003743   \n",
       "YDL244W      0.009852   0.000000  0.001278         0.012945      0.024693   \n",
       "YDL243C      0.019608   0.017242  0.020254         0.090263      0.113329   \n",
       "YDL241W      0.000000   0.017242  0.006374         0.000000      0.004988   \n",
       "YDL240W      0.000000   0.008658  0.005102         0.009725      0.009950   \n",
       "\n",
       "         stp2_YPEtOH  \n",
       "YDL248W     0.000000  \n",
       "YDL244W     0.061875  \n",
       "YDL243C     0.068520  \n",
       "YDL241W     0.000000  \n",
       "YDL240W     0.027974  \n",
       "\n",
       "[5 rows x 132 columns]"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "nb",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.18"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
